package com.rambo.androidnews.itemprovider;

import com.rambo.androidnews.ResourceTable;
import com.rambo.baselib.model.wanad.WanAdApiArticle;
import com.rambo.baselib.provider.BaseViewHolder;
import com.rambo.baselib.provider.ListItemProvider;
import ohos.app.Context;

import java.util.List;

/***********************************************************************
 * <p>@description:
 * <p>@author: rambo
 * <p>@version: 1.0.0
 * <p>@created on: 2022/1/13 16:57
 **********************************************************************/
public class ArticleItemProvider extends ListItemProvider<WanAdApiArticle, BaseViewHolder> {
    public ArticleItemProvider(Context context, List<WanAdApiArticle> data) {
        super(context, ResourceTable.Layout_componet_article_item, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, WanAdApiArticle item, int position) {
        helper.setText(ResourceTable.Id_tv_title, item.getTitle())
                .setText(ResourceTable.Id_tv_author, "作者：" + item.getAuthor())
                .setText(ResourceTable.Id_tv_time, "发布时间：" + item.getPublishTime());
    }
}
